<!DOCTYPE html>
<html>
<head>
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
  <script>
    var xmlhttp = new XMLHttpRequest();

    function openApp() {
      window.location = 'intent://test/#Intent;scheme=test;package=com.chrome.test;end';
    };

    function xhrOnReadyStateChange() {
      if (xmlhttp.readyState==4 && xmlhttp.status==200) {
        setTimeout(openApp, 11000);
      }
    };

    function xhrAndOpenApp() {
      xmlhttp.onreadystatechange = xhrOnReadyStateChange;
      xmlhttp.open("GET", 'hello.html' , true);
      xmlhttp.send();
    };
  </script>
</head>
<body style='height:10000px;' onclick='xhrAndOpenApp();'>
  Click page to open App!!
</body>
</html>
